<Form-Item label="节点:"  prop="node" style="width:750px">
    <Transfer :data="nodeData" 
        :target-keys="nodeKeys" 
        :list-style="listStyle" 
        :render-format="renderX"
        :titles="['未选节点','已选节点']"
        @on-change="handleChangeNode"
    ></Transfer>
</Form-Item>

nodeData: [],
nodeKeys:[],
listStyle: {
    width: '273px',
    height: '120px'
},
node_list: [],


get_node_list(){
    post(task_node_simple_list).then(response=>{
        let data = response.data
        this.node_list = data
    })
},
// 穿梭框左侧数据
get_node_data(){
    let node_data = [];
    let node_list = this.node_list;
    let nodeIds =   this.task_edit.nodes;
    for(let i=0;i<node_list.length;i++){
        if (nodeIds.indexOf(node_list[i].id) == -1){
            node_data.push({
                key: node_list[i].id.toString(),
                label: node_list[i].alias+"("+node_list[i].host+")",
                description: node_list[i].alias,
                // disabled:false
            })
        }else{
                node_data.push({
                key: node_list[i].id.toString(),
                label: node_list[i].alias+"("+node_list[i].host+")",
                description: node_list[i].alias,
                // disabled: true
            })
        }
    }
    // console.log("左侧节点数据:",node_data)
    this.nodeData = node_data;
},
//穿梭框右侧数据
get_node_keys(){
    // 要转字符串
    let keys =this.task_edit.nodes.map(item=>item.toString());
    console.log("已选节点:",keys)
    this.nodeKeys = keys;
},
renderX(item){
    return item.label;
},
handleChangeNode(newTargetKeys){
    this.nodeKeys = newTargetKeys;
},
// 编辑
btn_edit_task(index){
    if (this.show_list[index].status == STATE_RUNNING){
        alert("正在运行的任务无法编辑,请先停止")
        return
    }
    this.get_task_detail(this.show_list[index].id)
    this.get_node_list()
    setTimeout(() => {
        this.get_node_data()
    },100),
    setTimeout(() => {
        this.get_node_keys()
    },100),
    setTimeout(() =>{
        this.show_edit_task_modal=true
    },300); 
},